package cn.javass.dp.decorator.example6;

public class CheckDecorator extends Decorator{

    public CheckDecorator(GoodsSaleEbi ebi) {
        super(ebi);
    }

    @Override
    public boolean sale(String user, String customer, SaleModel saleModel) {
        if (!"张三".equals(user)) {
            System.out.println("对不起"+ user + "没有操作权限");
            return false;
        } else {
            //为什么用this
            return this.ebi.sale(user, customer, saleModel);
        }
    }
}
